UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L5LIAdlH6gEQsWsTzZ8ktJC31XYWQU4f2dkaEAFkGmI='
WHERE
key_id = 'e72e52f4fade89efe65dd543848ea69a8c4c506c36801f4ea446a31d6e0f5df9'
AND (
token = 'L5LIAdlH6gEQsWsTzZ8ktJC31XYWQU4f2dkaEAFkGmI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)