UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PDxTxkSTij+OZZhQhTLkIXVqB6wqRMxJAUCCXAs0gH4='
WHERE
key_id = '9ea3eea43f32001220a79afab8ebafce9efaf326cf72f4ba1e4926c8135fd3ef'
AND (
token = 'PDxTxkSTij+OZZhQhTLkIXVqB6wqRMxJAUCCXAs0gH4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)