UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Iz5LExfSp/vNUwPmFD26UgJv7MYyjzl0rEANzBG4WL8=' 
WHERE 
  key_id = 'fa6ef2215d0d19865e6f5bc53decb15dcd8e650e3dbe6e3cdf3e9489020f7d43' 
  AND (
    token = 'Iz5LExfSp/vNUwPmFD26UgJv7MYyjzl0rEANzBG4WL8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018