UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rGhMPoCNJb4Ji1lFXArw/qUiDsbLBN0o1a3W7DZdtmA='
WHERE
key_id = 'fab4380ffbf472fa28883c3a8c30d6d18557ea3bb6d2c638cc51f157fc35198d'
AND (
token = 'rGhMPoCNJb4Ji1lFXArw/qUiDsbLBN0o1a3W7DZdtmA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)