UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X+Ro8dMGtSyNlSfSAK5ZQ2g4ThRfstDa0+cQDmlbP20='
WHERE
key_id = '9dceccb768bef6183e2868882ffea9b1fa62848cde0b3e39ee7b8d9554f41075'
AND (
token = 'X+Ro8dMGtSyNlSfSAK5ZQ2g4ThRfstDa0+cQDmlbP20='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)