UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wGJ+P6zq4Xo+MBgljo7yhVH83tiLA+wCrmZtZ9SQ7uA='
WHERE
key_id = '1f9f277ed479ed00ee6d49a9df2112d20f1bffaf31a78aef2c91ae5ac11db925'
AND (
token = 'wGJ+P6zq4Xo+MBgljo7yhVH83tiLA+wCrmZtZ9SQ7uA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)