UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aNW++kfgku+NDXssD22jnapUlg0uYu2aurVxwdImT4s=' 
WHERE 
  key_id = '6b14c1cbbc0543188b50646d8b55efc4f72b2aa1f6341af5ab7a05933df56163' 
  AND (
    token = 'aNW++kfgku+NDXssD22jnapUlg0uYu2aurVxwdImT4s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033