UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P0MCOsF6WpcmsZHwBSalQ+jDRJUs7unGFC0zCZGgxro='
WHERE
key_id = '92fcc1d325559f2fda5f745afbc32f56ba6678981555fc47f7ee7d2dffee0686'
AND (
token = 'P0MCOsF6WpcmsZHwBSalQ+jDRJUs7unGFC0zCZGgxro='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)