UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/T78dmMMB8jKzVX60nw5l7oQudTIVkXYmuwK7r9UdyI='
WHERE
key_id = 'b71f266f9c5bac00b5ec48ca348dc293c9a7ecc27c67350e767631200ef0b34d'
AND (
token = '/T78dmMMB8jKzVX60nw5l7oQudTIVkXYmuwK7r9UdyI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)