UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kUD+3m2Qkxi9JFxuO9jzkU4DiBDEtcDcEoNaUkH+wW0='
WHERE
key_id = 'c737a47b812c9d1ca12792fa8c09b9990370c961c084ad6e51d0562a3d1d9fe9'
AND (
token = 'kUD+3m2Qkxi9JFxuO9jzkU4DiBDEtcDcEoNaUkH+wW0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)