UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oguWt77C/GEM55y6z+H0OqNsvNxKjUKTeqo3llJfC/c='
WHERE
key_id = '5e04b5804894e03eef3487852ee8802cd8eef053e0567b83eabd0fcfe0ce3217'
AND (
token = 'oguWt77C/GEM55y6z+H0OqNsvNxKjUKTeqo3llJfC/c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)