UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/UP89vU2s5j7A7Cw2DUgNBNxwuBhqiDW8SG/dhkwX/o='
WHERE
key_id = 'e23e6a96d7c034bb3277e07e5525d5881780114e978a171d63ee44456ddfb6e8'
AND (
token = '/UP89vU2s5j7A7Cw2DUgNBNxwuBhqiDW8SG/dhkwX/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)