UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1ZJHAUEdGrQFYF9iq4aexm+n2wsAuDr73EwltdmAA5I=' 
WHERE 
  key_id = '4b25decd85c38cda961961e32a20a83bedec098668bd294f2367f2f5d11fda04' 
  AND (
    token = '1ZJHAUEdGrQFYF9iq4aexm+n2wsAuDr73EwltdmAA5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039