UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jR+okPKz69KO1bnPqNKsmBzVWQjlZod1NjxJdvIlq4k=' 
WHERE 
  key_id = '01959f2a455d9230b1a607231fb51185e6eab8b2e0297ea92b0197133b54da0b' 
  AND (
    token = 'jR+okPKz69KO1bnPqNKsmBzVWQjlZod1NjxJdvIlq4k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00092