UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+JiLeaiOM1t6VGhfeMCQLXfAThHQdG/I7uxIeHWagR8=' 
WHERE 
  key_id = '66430be76ec5943c3954e681ab7462c87e114872d206dd4f6c4e2d6bc381247c' 
  AND (
    token = '+JiLeaiOM1t6VGhfeMCQLXfAThHQdG/I7uxIeHWagR8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041