UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LZkJ9+7hfzh3EOZF4PJ8gRTqJ3aymMT1ioudawShvho='
WHERE
key_id = '1fdb476c6df8b7cd52c70545906d9e968c657436baf2c663bbc47eec52ae9229'
AND (
token = 'LZkJ9+7hfzh3EOZF4PJ8gRTqJ3aymMT1ioudawShvho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)