UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FKi6BBFjLncsTPr7OCmOW1YcuwnKNbJ+nnFcGBi6WQo='
WHERE
key_id = '255eabd749c79e3f560d73362fc064637e1ed5f609f121070428143a91f40ae8'
AND (
token = 'FKi6BBFjLncsTPr7OCmOW1YcuwnKNbJ+nnFcGBi6WQo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)