UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/dwcR95M61xzxM/qmNAFyeM/kIHNLfoh92lLiPC8oFU='
WHERE
key_id = '3177d7c9468183b7380781c414ebf4d4d7e741bd22c4c800fed2c42710f1a570'
AND (
token = '/dwcR95M61xzxM/qmNAFyeM/kIHNLfoh92lLiPC8oFU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)