UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4Bw229iszlk4AtaQtAWRgw/FEB7WMvNPIGOVo0MG1ME=' 
WHERE 
  key_id = '9dd5f1cd4a697ba489b524465dcf6f7e2cc6a54f5d9ef60682d5ebb6102da58e' 
  AND (
    token = '4Bw229iszlk4AtaQtAWRgw/FEB7WMvNPIGOVo0MG1ME=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029