UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FsLxjbE3NOsJ/it+Q87vaK+CvLkCI6dAIpSEZlPtVA4=' 
WHERE 
  key_id = '0d0ad336151f2df8163276c1b240e741c2097af5deaa4b482508a1c1a4379020' 
  AND (
    token = 'FsLxjbE3NOsJ/it+Q87vaK+CvLkCI6dAIpSEZlPtVA4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035