UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p2i3dWmkyv0teAvzbLG/gUZqCJiFC5apbnDLydg5AaU='
WHERE
key_id = '26be27eebcd68d31f30b036ba7a287861a79093ed9f61a791b0dde1cedd3d236'
AND (
token = 'p2i3dWmkyv0teAvzbLG/gUZqCJiFC5apbnDLydg5AaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)