UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '//QifUwjioM9PGV13aUAJ/ym3grxzB1d+f4E/05diE0=' 
WHERE 
  key_id = '69a06509d536dba4af2daf89eae6517e079586077e3a494a9ef8fd870606fca1' 
  AND (
    token = '//QifUwjioM9PGV13aUAJ/ym3grxzB1d+f4E/05diE0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040