UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JM7fH2es7ZvddbUei5sX8ISy2A+skjiFibcuTkwgqTw=' 
WHERE 
  key_id = '68412d8f0b3db4178fb432c1725383104b80487328454d6a7889f5064bf7d142' 
  AND (
    token = 'JM7fH2es7ZvddbUei5sX8ISy2A+skjiFibcuTkwgqTw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045