UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+dHnlx/SGiwJ9N+Pijt2Qj7MXFuISfUymjFmxkJ2w1k='
WHERE
key_id = 'b40a80c4b2416727a43bd4f78e925d557431920ce9c74309dc6657d4c4f0cded'
AND (
token = '+dHnlx/SGiwJ9N+Pijt2Qj7MXFuISfUymjFmxkJ2w1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)