UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'flQG/YE6Beek/tIpsK8PVGpVuA1LQucoV3NBu/rlMh8='
WHERE
key_id = 'f55e2e97723183770f3c1f378a7ed3853814cee4f318528860d72511dc30f6f5'
AND (
token = 'flQG/YE6Beek/tIpsK8PVGpVuA1LQucoV3NBu/rlMh8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)