UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AqhTjGe80aE4Lyv1Lr5o+N1MxTU6s77FVDu4oLyV79A='
WHERE
key_id = 'de1fb5eba72ede6753507011124e7db5938a9c6ec300b9354670dcf3a5a17184'
AND (
token = 'AqhTjGe80aE4Lyv1Lr5o+N1MxTU6s77FVDu4oLyV79A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)