UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hT6W9gyzkRZNxQQ0h1CyH/TVPr9uVxlVwFq3IGi3LK0='
WHERE
key_id = '8303746a8ad8409a18db3ac1e40f646851ccec74e0652df8fdc18517655853db'
AND (
token = 'hT6W9gyzkRZNxQQ0h1CyH/TVPr9uVxlVwFq3IGi3LK0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)