UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EfwrkVRLRwxm5qm86IFbO9NFplqRKAi8SyTQMpEBIIo=' 
WHERE 
  key_id = '92e4f3313ee33d8d7d98346e9a55fd0b7151e6518b05ee8b4367264f11a155f7' 
  AND (
    token = 'EfwrkVRLRwxm5qm86IFbO9NFplqRKAi8SyTQMpEBIIo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044