UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eRyFq2v7QX8WirOMNVlsftSGwTpTLdArPSKNd9mxYaM='
WHERE
key_id = '657bea9cceab039d09fad506ae8a5f8934465f10f6e62d388ce9d48a2abbe0c6'
AND (
token = 'eRyFq2v7QX8WirOMNVlsftSGwTpTLdArPSKNd9mxYaM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)