UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '70fvZKnrj830izZzcXJdm5ghs7lLbTr/sN3WlDY+uVo='
WHERE
key_id = 'd913c76caf6780426f1d598e7b10a4ee6326a781d575b18dfd6c27241c2b3318'
AND (
token = '70fvZKnrj830izZzcXJdm5ghs7lLbTr/sN3WlDY+uVo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)