UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HzvWLqwMi4u/j5uR3sgHIX/VpRdCJ6DTF0x6AU7+6EI='
WHERE
key_id = 'ecf018e563c4fae007decbc90ade71c01d439b6e072b03981720dfabf1c87e34'
AND (
token = 'HzvWLqwMi4u/j5uR3sgHIX/VpRdCJ6DTF0x6AU7+6EI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)