UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y5t95GmMayR8UoiYE4FjbUrKgKshQZxW3vUOnr2W9/g='
WHERE
key_id = '81214f22ca7571f3509010649bd61903157603e045bbc1601c6a8de015f85392'
AND (
token = 'y5t95GmMayR8UoiYE4FjbUrKgKshQZxW3vUOnr2W9/g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)