UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '60S2XBU4vlfFPSHi8Zd0Lzr3jdOs7dCD0iqfazcxijY=' 
WHERE 
  key_id = '8c94650b96cafbbb70e92673a8ca8ec1b7976c30a383d0b1626326171c10b090' 
  AND (
    token = '60S2XBU4vlfFPSHi8Zd0Lzr3jdOs7dCD0iqfazcxijY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050