UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MReg9/LiTZ5r3E1mweVuTa6FGLAo4hMn4TNeJLLf6xE='
WHERE
key_id = 'c68684be5d356871b6d00fef4fe911fe10354a4949babb0254decfa366f057d1'
AND (
token = 'MReg9/LiTZ5r3E1mweVuTa6FGLAo4hMn4TNeJLLf6xE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)