UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1jDiDoqUauPrWtDd+wNBLZlh5iEDODC3iYzRhDLCHPk=' 
WHERE 
  key_id = 'cf2b64d6a16a345524c17b9c1766387ef118531d63501261180c6d6fe4a754d1' 
  AND (
    token = '1jDiDoqUauPrWtDd+wNBLZlh5iEDODC3iYzRhDLCHPk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035