UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'degBApvOAp7+/IMpdht0x37ZRDEMOqA8htT/YRBDzYQ='
WHERE
key_id = 'ac016932df6f171dd8e372cc4754780d9746af27a38459e3b19e23c94cea13db'
AND (
token = 'degBApvOAp7+/IMpdht0x37ZRDEMOqA8htT/YRBDzYQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)