UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BoJPysrGzgc4PnOEiDAlWOzR53IA0hlJCxjcD+cUuPA='
WHERE
key_id = '4e8be9df92ae45fa1d408532ec1865cbd50bf50edc31a42460fc0d49e14e1219'
AND (
token = 'BoJPysrGzgc4PnOEiDAlWOzR53IA0hlJCxjcD+cUuPA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)