UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bzXSxE5HrUDP8D8zTdGmiPgevdeYu6USuQN2YK6GNv4=' 
WHERE 
  key_id = '5e69a71b70935d29d978cee4245ca8e39babf443a1fb398390c55d5fd9b88c63' 
  AND (
    token = 'bzXSxE5HrUDP8D8zTdGmiPgevdeYu6USuQN2YK6GNv4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029