UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I/0KRqentYwCPTE5Sj9FRB+f8S/BYGh/WSzbWpnJ344='
WHERE
key_id = 'df1c793299b605a342b4d1c8a7c48fe95a3c3ff907f11cf039f280fec8af2369'
AND (
token = 'I/0KRqentYwCPTE5Sj9FRB+f8S/BYGh/WSzbWpnJ344='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)