UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zb3B8JsLAznHecBr8UoKJBuzLR59wEjtuZTK50COii8='
WHERE
key_id = '33011b1f6571b1a5b6fd3f5ffbc217c9d602804d3ada3ed9ef9c953149ca7417'
AND (
token = 'Zb3B8JsLAznHecBr8UoKJBuzLR59wEjtuZTK50COii8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)