UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HegZI8u2On+ny1Am/xTp375FY6YJe0rGUDgQe2wKUFQ=' 
WHERE 
  key_id = '3f8f7e7fe655e4cb92273419a02b54b49fe49cef32e6f91e5cf99c2db9c2ac46' 
  AND (
    token = 'HegZI8u2On+ny1Am/xTp375FY6YJe0rGUDgQe2wKUFQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035