UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MZtOxY/GWw8sp6SQcD1T5nabbo2LSbO19GwmQwvpnwc=' 
WHERE 
  key_id = 'ccfd91ee4f25e776ca51ab3aa5c09a8999d7750bc98415f18bbab334c26406b6' 
  AND (
    token = 'MZtOxY/GWw8sp6SQcD1T5nabbo2LSbO19GwmQwvpnwc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033