UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BtAGWQc4pBpKBiKgMBWuUzUz1zXfw8TmEQdFxWHqN5E=' 
WHERE 
  key_id = '8e3db71b8f78611b3495fc1400c77a786ead2fe06b80cd071fb5bc71ea50eae4' 
  AND (
    token = 'BtAGWQc4pBpKBiKgMBWuUzUz1zXfw8TmEQdFxWHqN5E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033