UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '43YRYf4Jd0DCeNvGzr3E16jsXlqthRgfNcd97YIGEV8=' 
WHERE 
  key_id = '7e7a5fb284f7d6a0e175c6569bb3cf83e6784fcfdb5480351d4045fd7fe4a4af' 
  AND (
    token = '43YRYf4Jd0DCeNvGzr3E16jsXlqthRgfNcd97YIGEV8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027