UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uSm28mztEzDQfi/ztuT2VEKaf/yjN4Re4IlosDIrsfc='
WHERE
key_id = 'ed4fc5952ae09c4de52f724cbf561e0b47e0b9b667d6da524f4a4e73ab980204'
AND (
token = 'uSm28mztEzDQfi/ztuT2VEKaf/yjN4Re4IlosDIrsfc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)