UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3RKJPTqN7f+mkyRw2hFlFVmMeC0mTkZR3/xVI6KTd5k=' 
WHERE 
  key_id = '2365f1a910dac17ce4ed871334052d5f1d659039ab2480a87fea5fe567e8e708' 
  AND (
    token = '3RKJPTqN7f+mkyRw2hFlFVmMeC0mTkZR3/xVI6KTd5k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027