UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PWnsacpkzMtiI8tQLnu/bat4Vhj6e40A6BnXfif3eQQ='
WHERE
key_id = '96565863572fdf61c3d07f4183674d7bddb7c646d8390ea3d8cdaaad903315f2'
AND (
token = 'PWnsacpkzMtiI8tQLnu/bat4Vhj6e40A6BnXfif3eQQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)