UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6dxg7OfmHnF4xmKV+EWZtB5WNKaLmNiEtNJKY3Z6ulw='
WHERE
key_id = 'c8ee1f37acd62d7a990bf0535ba811f6bb1c151f44640115ce3cdcd8f60db602'
AND (
token = '6dxg7OfmHnF4xmKV+EWZtB5WNKaLmNiEtNJKY3Z6ulw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)