UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I2M+V5miWPJFWK4k6qpE/zsVm4w6gUTe9CNrd2w0VUU='
WHERE
key_id = 'f530b2551b7759d3f66a4e51218c308843c04c3553474c7b06260736d9e6a103'
AND (
token = 'I2M+V5miWPJFWK4k6qpE/zsVm4w6gUTe9CNrd2w0VUU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)