UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eFPy8uDpjUJ+XnlwJn1TWNx0U+ByDjrkxRGSC4nJlHw=' 
WHERE 
  key_id = '419617c1168e97a10e75649fded048078cba86ebe157ec53818a2b68caa9d7f5' 
  AND (
    token = 'eFPy8uDpjUJ+XnlwJn1TWNx0U+ByDjrkxRGSC4nJlHw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041